package com.acwing.partition36;

import java.io.*;

/**
 * @author rkc
 * @date 2022/8/7 9:06
 */
public class AC3593统计单词 {

    private static final int N = 1010;
    private static char[] p = new char[N];
    private static int n;

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        String s = reader.readLine();
        p = s.toCharArray();
        n = s.length();
        for (int i = 0; i < n; ) {
            int j = i + 1;
            while (j < n && p[j] != ' ' && p[i] != ' ') j++;
            int res = j - i;
            if (p[i] != ' ') {
                if (j >= n) res--;
                writer.write(res + " ");
            }
            i = j;
        }
        writer.flush();
    }
}
